﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace eTerm.PlugIn.TicketImport
{

    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmImport());
        }
    }


    public partial class frmImport : Form
    {
        public frmImport()
        {
            InitializeComponent();
        }

        private void btnAction_Click(object sender, EventArgs e)
        {
            OpenFile();
        }

        private delegate DialogResult OpenFileCallBack();

        [STAThread]
        private DialogResult OpenFile()
        {
            if (this.InvokeRequired) {
                IAsyncResult result=  this.BeginInvoke(new OpenFileCallBack(OpenFile));
                return (DialogResult)result.AsyncState;
            } else {
                DialogResult result = openFileDialog1.ShowDialog();
                if (result == DialogResult.OK) {
                    btnAction.Text = @"开始导入票号";
                }
                return result;
            }
        }

    }
}
